<?php 
session_cache_expire(999999999);
if(!isset($_SESSION)) 
{ 
	session_start(); 
}

if(isset($_REQUEST['vitri']) && isset($_REQUEST['idnf']) && isset($_REQUEST['vidviewpro'])){
	$vitri=$_REQUEST['vitri'];
	$idnf= $_REQUEST['idnf'];
	$vidviewpro=$_REQUEST['vidviewpro'];
	$lang = $_SESSION['lang'];
	if (empty($lang) || $lang == "EN") {
		include '../../value/value_en.php';
	} else if($lang == "VN") {
		include '../../value/value_vn.php';
	}
	else {
		include '../../value/value_kr.php';
	}
	include 'nf_objnewfeature.php';
	if(isset($_SESSION['listnewfeature'][$vitri])){
		$obj= new nf_newfeature();
		$obj=unserialize (serialize($_SESSION['listnewfeature'][$vitri]));
		?>
		<td class="rf-dt-c" style="width:5% ;vertical-align: middle; text-align: center;min-width: 5%"><?=$vitri?></td>
		<td class="rf-dt-c" style="width:9%;vertical-align: middle; text-align: center;min-width: 9%"><?=($vidviewpro.'-'.$obj->nf_order)?></td>
		<td class="rf-dt-c" style="padding: 0; vertical-align: middle;" colspan="4">
			<div style="background:white; border:1px solid #c4c0c9; padding:10px;margin:9px;" >
				<div  class="acomment" style="background:white; border:1px solid #c4c0c9; padding:10px;display: none;" id="<?php echo 'idnf_showaddcomment'.$vitri;?>" >
                    <span style="display: block; text-align: left"><?php echo $l_comment?> : </span>
                    <textarea style="width:100%; border:1px solid #c4c0c9" cols="5" rows="3" id="<?php echo 'titlecomment'.$vitri;?>" name="comment"></textarea>
                    <div style="text-align:right">
                    	<input class="buttonProject" type="button" style="margin: 5px 0;" value="<?php echo $l_ok?>" onclick="add_comment_newfeature(<?=$vitri?>,'<?=$obj->nfid?>','<?=$vidviewpro?>',this);"/>
                    	<input class="buttonProject aclose" type="button" style="margin: 5px 0;" value="<?php echo $l_cancel?>" id="cancelthemcommand" onclick="closethemcommand(this)"/>
                    </div>
				</div>
				<div class="odd1" style="padding-left:10px;border:1px solid #ddd; font-size: 13px;">
					<div  style="background:#f7f7f7; padding:10px;  font-weight:bold; color:#b02323"><?=$obj->nf_title?></div>
					<div style="background:#ffffff;  padding:10px; "><?=$obj->nf_content?></div>
					<div style="border-bottom: 1px dotted gray; padding-bottom: 5px;margin-bottom: 5px;"></div>
				</div>
				<div class="clear"></div> 
				<div style="background:#f7f7f7; width:100%;">
					<div style=" padding:10px; font-size:11px; color:#000; float:left; width:60%"><?=($obj->nf_employee_name.'('.$obj->nf_createdate.')')?></div>
			        <div style="float:right;">
			        <?php 
						if($obj->nf_employee==$_SESSION['IDEmployee']){
                    		?>
                    		<input class="buttonProject "  style="margin: 5px 0;width: 70px" type="button" value="<?=$l_update?>" onclick="update_newfeature('<?=$obj->nfid?>');" />
                    		<?php 
                    	}
			        ?>
			        	<input class="buttonProject hcomment"  style="margin: 5px 0;width: 70px" type="button" value="<?=$l_comment?>" onclick="show_addcomment_newfeature(<?=$vitri?>)" />
						<input class="buttonProject hclose"  style="margin: 5px 0;width: 70px" type="button" value="<?=$l_close?>" onclick="close_showdetail_newfeature(<?=$vitri?>,'<?=$vidviewpro?>')" />
			        </div>
			        <div class="clear"></div> 
				</div>
				<div style="background:white; padding:5px; border:1px solid #ddd; font-size: 13px;" >
					<div style="background:white; padding:5px; border:1px solid #ddd;" id="<?php echo 'idnf_showallcomment'.$vitri;?>">
					<?php 
						$sql="SELECT nfc.nfid_comment,nfc.nf_contentcomment,nfc.nf_datecomment,nfc.nf_employee,nfc.nf_employee_name from pr_newfunction_comment nfc where nfc.nfid_newfunction='".$obj->nfid."' order by nfc.nf_datecomment desc";
						include '../../operations/connection.php';
						$rs=mysql_query($sql);
						if(count($rs)>0){
							?>
							<table width="100%" >
								<?php 
								$cvitri=0;
								while($r=mysql_fetch_array($rs)){
									?>
									<tr style="background: <?php if(++$cvitri%2==0) echo '#f2f9ff'; else echo '#ffffff';?>; font-size: 13px;">
										<td class="rf-dt-c" style="padding: 0; vertical-align: middle; width: auto;">
										<span style="font-size: 13px;"><?=(' + '.stripslashes($r['nf_contentcomment']))?></span>
										<i style="color:#424242; display:block; text-align:right; padding-top:5px;padding-right:15px; font-size: 13px;"><?php echo $r['nf_employee_name']." (".$r['nf_datecomment'].")"?></i>
										</td>
									</tr>
									<?php 
								}
								?>
							</table>
							<?php 	
						}
						mysql_close($connection);
					?>
	                </div>
				</div>
	                        	
			</div>
		</td>
		<?php 
	}
}
?>